<template>
	<view class="popup" v-if="showPopup">
		<view class="overlay" v-show="showPopup"></view>
		
		<!-- 审核详情弹框 -->
		<view :class="isAgree==true?'popup_checks':'popup_check'" v-if="showPopup">
			<view class="popup_header" v-if='popup.isPopupHeader'>				
				{{popup.title}}
			</view>
	
			<!-- 特殊内容弹框 -->
			<view  :class="isAgree==true?'popup_contents':'popup_content'">
				<view class="popup_msg" v-if='type=="transfer"'>
					<text v-if='isAgree==false'>是否确认拒绝
						<text class="name">{{popup.name}}</text>转会？</text>
					<text v-if='isAgree'>是否同意<text class="name">{{popup.name}}</text>转会？</text>
				</view>
				<view class="popup_msg" v-if='type=="noCheck"'>
					<text v-if='isAgree==false'>是否确认拒绝
						<text class="name">{{popup.name}}</text>成为会员？</text>
					<text v-if='isAgree'>是否同意<text class="name">{{popup.name}}</text>成为会员？</text>
				</view>
				<view class="popup_input" v-if='popup.isPopupInput'>
					 <!-- <input class="uni-input" adjust-position confirm-type="done"  placeholder="请简要说明拒绝理由" v-model="popup.txtReason" /> -->
					  <view class="uni-textarea">
								<textarea placeholder-style="color:#F76260" placeholder="请简要说明拒绝理由" v-model="popup.txtReason" fixed="true"  maxlength="-1"/>
						</view>
				</view>
			</view>
		
			<view class="footer" v-if='popup.isPopupFooter'>
				 <button  size="mini" class="btns" plain="true" @tap.stop="cancel()">{{popup.cancelMsg}}</button>
				 <button  size="mini" class="btns" @tap.stop="agree()">{{popup.confirmMsg}}</button>
			</view>
		</view>
		
	</view>
</template>

<script>
	export default{
		data(){
			return{
			}
		},
		props:{
			type:String,
			showPopup:{
				type:Boolean,
				default:true
			},
			isAgree:Boolean,
			popup:{
				type:Object,
				default:{
					cancelMsg:"取消",
					confirmMsg:"确认",
					txtReason:'',
					isPopupHeader:true,
					isPopupInput:true,
					isPopupFooter:true,
					isPopupContent:true,
					title:'',
					content:'',
					orgname:'',
					name:''
				}
			},
		},
		components:{
			// uniPopup
		},
		methods:{
			agree(){
				var _this=this;
				if(_this.isAgree){
					_this.$emit("toAgree");
				}else{
					_this.isFocus=true;
					_this.$emit("toNotAgree",_this.popup.txtReason)
				}
			},
			cancel(){
				var _this=this;
				_this.$emit("toCancel")
			},
			exit(){
				uni.clearStorageSync()
			},
		}
	}
</script>

<style lang="less" scoped>
	.popup_check{
		width: 100%;
		min-height: 400rpx;
		background: #fff;
		opacity: 1;
		position: fixed;
		bottom: 0;
		// left: 10%;
		display: flex;
		flex-direction: column;
		// top: 30%;
		font-size: 28rpx;
		z-index: 1100;
	}
	.popup_checks{
		width: 100%;
		min-height: 300rpx;
		background: #fff;
		opacity: 1;
		position: fixed;
		bottom: 0;
		// left: 10%;
		display: flex;
		flex-direction: column;
		// top: 30%;
		font-size: 28rpx;
		z-index: 1100;
	}
	.overlay{
		position: fixed;
		width: 100%;
		height: 100%;
		left: 0;
		top: 0;
		opacity: 0.7;
		background:rgba(0,0,0,0.4);
	}
	.popup	.close_height{
		width: 80%;
		min-height: 340rpx;
		background: #fff;
		opacity: 1;
		position: absolute;
		left: 10%;
		top: 35%;
		font-size: 28rpx;
		z-index: 1000;
		// overflow-y: auto;
	}
 .popup_header{
		text-align: center;
		padding:10rpx;
		border-top: 2rpx solid #f1f1f1;
		border-bottom: 2rpx solid #f1f1f1;
		font-size: 32rpx;
	}
	.popup_title{
		padding: 30rpx 20rpx 30rpx;
	}
	.popup_content{
		min-height: 300rpx;
		margin-top: 20rpx;
	}
	.popup_contents{
		margin-top: 20rpx;
		min-height: 200rpx;
	}
	.popup_msg{
		margin-left: 16rpx;
		margin-bottom: 10rpx;
		overflow-y: scroll;
		overflow-x: hidden;
		padding-right: 16rpx;
		.name{
			color: red;
			padding: 0 10rpx;
		}
	}
	
	.popup_msg::-webkit-scrollbar{
		width: 0;
		height: 0;
		color: transparent;
	}
	.popup_input{
		border: 2rpx solid #f1f1f1;
		margin: 0 20rpx;
		padding: 20rpx;
		border-radius: 20rpx;
		margin-bottom: 100rpx;
		.uni-input-placeholder{
			font-size: 24rpx;
		}
		.uni-input-input{
			font-size: 24rpx;
		}
		textarea{
			width: 670rpx !important;
			min-height: 100rpx !important;
			height: 60rpx !important;
			line-height: 40rpx;
		}
	}
	.btns_cancel{
		position: absolute;
		bottom: 0;
		width: 100%;
		padding: 20rpx 0;
		text-align: center;
		border-top:2rpx solid #f1f1f1;
		color: #409eff;
		background: #f1f1f1;
	}
	.blue{
		color: #2680EB;
	}
	.red{
		color:#f78989 ;
	}
	.footer{
		position: absolute;
		bottom: 10rpx;
		display: flex;
		flex-direction: row;
		justify-content: space-between;
		width: 100%;
		.btns{
			width: 45%;
			text-align: center;
			// font-size: 28rpx;
		}
		.btns:first-child{
			border: 2rpx solid #2D8DFF;
			color: #2D8DFF;
		}
		.btns:last-child{
			background:  #2D8DFF;
			color: #fff;
		}
		.fblue{
			border-top: 2rpx solid #f1f1f1;
			color:#2680EB ;
		}
		.lblue{
			background: #2680EB;
			color: #fff;
		}
		.fred{
			border-top: 2rpx solid #f1f1f1;
			color:#f78989 ;
		}
		.lred{
			background: #f78989;
			color: #fff;
		}
	}
</style>
